﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LServer.Core.Utils
{
    public class LFDateTimeUtil
    {
        #region GetTimestamp 获取时间戳
        /// <summary>
        /// 获取时间戳 定义为从格林尼治时间 1970年01月01日00时00分00秒起至现在的总秒数
        /// </summary>
        /// <returns></returns>
        public static long GetTimestamp() 
        {
            return (DateTime.UtcNow.ToUniversalTime().Ticks - 62135596800000000) / 10000000;
        }

        public static long GetTimestamp(DateTime deteTime)
        {
            return (deteTime.ToUniversalTime().Ticks - 62135596800000000) / 10000000;
        }

        #endregion
    }
}
